package com.xbongbong.pro.smartsettings.pojo;

import com.xbongbong.pro.enums.smartsettings.enums.StrategyTypeEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @description: 执行策略pojo
 * @Author: hongxiao
 * @date: 2019-04-23 22:06
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class SmartStrategyPojo implements Serializable {
    private static final long serialVersionUID = -1L;

    /**
     * 策略类型
     * @see StrategyTypeEnum
     */
    @NotNull(message = "策略类型不能为空")
    @Range(min = 1, max = 6, message = "策略类型不正确")
    private Integer strategyType;
    /**
     * 策略周期（默认为1，自定义可设置大于1）
     */
    private Integer strategyCycle;
    /**
     * 自定义策略类型
     * @see com.xbongbong.pro.enums.CustomStrategyTypeEnum
     */
    private Integer customType;
    /**
     * 策略日期（日期计算）
     */
    private String strategyDay;
    /**
     * 策略日期（星期计算）
     * @see com.xbongbong.pro.enums.WeekEnum
     */
    private Integer strategyWeek;
    /**
     * 策略时间
     */
    private String strategyTime;
    /**
     * 策略执行次数
     */
    @NotNull(message = "执行次数不能为空")
    @Range(min = 1, max = 30, message = "策略执行次数年只能在1~30之间")
    private Integer strategyNum;

    public SmartStrategyPojo() {
        this.strategyCycle = 1;
        this.strategyNum = 1;
    }
}
